disconnect stdio for wasm binaries
authorJoey Hess <joeyh@joeyh.name>
Fri, 7 Mar 2025 21:15:21 +0000 (17:15 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 7 Mar 2025 21:15:21 +0000 (17:15 -0400)
doc/special_remotes/compute/git-annex-compute-wasmedge

index c20f7824a87bb2045cc4decd967955f9dfed3075..a734418125632d4b8669e6c3c7ca3e20e9dce067 100755 (executable)
@@ -43,5 +43,10 @@ if [ -n "$wasm" ]; then
        # Use --force-interpreter to avoid wasmedge running AOT native
        # instructions, which is insecure if the WASM binary comes from
        # an untrusted source.
-       wasmedge --dir "/:`pwd`" --force-interpreter -- "$wasm" "$@" >&2
+       #
+       # Avoid displaying output from the WASM binary, since it is
+       # untrusted, and could contain harmful terminal escape sequences,
+       # for example.
+       wasmedge --dir "/:`pwd`" --force-interpreter -- "$wasm" "$@" \
+               >/dev/null 2>/dev/null </dev/null
 fi